package com.chuiyuan.utils;

import java.io.*;

/**
 * Created by chuiyuan on 2/11/16.
 */
public class StreamUtils {
    public static String stream2String(InputStream in ) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        String line = null ;
        StringBuffer buffer = new StringBuffer();
        while ((line=br.readLine())!= null){
            buffer.append(line);
        }
        in.close();
        br.close();
        return buffer.toString();
    }
}






